package com.sky.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sky.entity.Setmeal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

/**
 * <p>
 * 套餐 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-02
 */
@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {
    @Select("select count(id) from setmeal where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);

    IPage<SetmealVO> selectSetmealWithCategory(Page<?> page, @Param("status") Integer status, @Param("categoryId") Long categoryId, @Param("name") String name);

    SetmealVO getSeatmealById(Long id);
}
